import request from '@/utils/request'

export const getRoleList = (params) => {
  return request.get('/sys/role', {
    params
  })
}

export const addRole = (data) => {
  return request.post('/sys/role', data)
}

export const updateRole = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}

export const getEnableRoleList = () => {
  return request.get('/sys/role/list/enabled')
}

export const getRoleDetail = (id) => {
  return request.get(`/sys/role/${id}`)
}

export const assignPrem = (data) => {
  return request.put('/sys/role/assignPrem', data)
}
